package defectsim;

public abstract class Dislocation extends DefectAgent{
	private boolean mobility; // mobility = true if mobile, false if immobile
	private boolean dipole; // dipole = true if dipole, false if monopole
	private Dislocation dipoleMate = null;
	private double velocity;
	private double distance;
	private double direction;
	private double unitBurgersVector;
	private double stress;
	
	public boolean isMobile() {
		return mobility;
	}

	public void setMobility(boolean mobility) {
		this.mobility = mobility;
	}
	
	public boolean isDipole() {
		return dipole;
	}

	public void setDipole(boolean dipole) {
		if (dipole){
			this.dipole = true;
			this.setMobility(false);
			this.setVelocity(0.0);
		}
		else {
			this.dipole = false;
			this.setMobility(true);
			this.setDipoleMate(null);
		}

	}

	public double getVelocity() {
		return velocity;
	}

	public void setVelocity(double velocity) {
		this.velocity = velocity;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}

	public double getDirection() {
		return direction;
	}

	public void setDirection(double direction) {
		this.direction = direction;
	}

	public double getUnitBurgersVector() {
		return unitBurgersVector;
	}

	public void setUnitBurgersVector(double unitBurgersVector) {
		this.unitBurgersVector = unitBurgersVector;
	}

	public void setDipoleMate(Dislocation dipoleMate) {
		this.dipoleMate = dipoleMate;
	}
	
	public Dislocation getDipoleMate(){
		return dipoleMate;
	}
	
	public int isDislocation(){
		return 1;
	}
	
	public int isMob(){
		if (mobility) return 1;
		else return 0;
	}

	public int isDip(){
		if (dipole) return 1;
		else return 0;
	}

	public double getStress() {
		return stress;
	}

	public void setStress(double stress) {
		this.stress = stress;
	}
	
	

}
